Second instance of DCOM server when "This user" is used on Windows 7
We have a COM component (local server say B.exe which runs on the same machine as client) that needs to run as a user who has administrative rights. However, user(s) who launch main application do not have administrative rights. We are using “CreateProcessWithLogonW” to launch COM component B with credential of a user who has administrative rights (In DCOMCNFG we specify the same user to run this COM component as “This user”) and later we call CreateInstance() to get the interface pointers to access the component. This mechanism works well on Windows XP. However this same mechanism doesn’t work on Windows 7, when we say CreateInstance(), DCOM tries to launch another instance of the process even though one is already running with the same user credential (by earlier call to CreateProcessWithLogonW). This DCOM attempt to launch another instance of the process times out with an error “server execution failed” To simplify on Windows 7, I tried a COM client & server test in which I logged into computer as a user who has administrative rights and specified the same user in DCOMCNFG to run the COM component as “This user”. I followed the same mechanism as above by using “CreateProcessWithLogonW” to launch COM component and then call CreateInstance() to get the interface pointers, even in this simple case DCOM tried to launch another instance of the process but failed after timeout with an error “server execution failed”. If in DCOMCNFG, I use any option other than “This user” then, it works fine. If both DCOM client and server are running under the same user account, why DCOM/COM launcher is not forcing client to use the existing server instance? What I am missing here?
January 27th, 2012 4:19pm

For development related questions, please discuss in our MSND forum. Windows Desktop Development http://social.msdn.microsoft.com/Forums/en-US/category/windowsdesktopdevPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2012 11:58pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics